import { axios } from '@/utils/request'

/**
 * 获取流程变量
 * @param taskId
 * @returns {*}
 */
export function getProcessVariables(taskId) {
  return axios({
    url: '/workflow/task/processVariables/' + taskId,
    method: 'get'
  })
}

/**
 * 通过任务
 * @param data
 * @returns {*}
 */
export function complete(data) {
  return axios({
    url: '/workflow/task/complete',
    method: 'post',
    data: data
  })
}

/**
 * 委派任务
 * @param data
 * @returns {*}
 */
export function delegate(data) {
  return axios({
    url: '/workflow/task/delegate',
    method: 'post',
    data: data
  })
}

/**
 * 转办任务
 * @param data
 * @returns {*}
 */
export function transfer(data) {
  return axios({
    url: '/workflow/task/transfer',
    method: 'post',
    data: data
  })
}

/**
 * 退回任务
 * @param data
 * @returns {*}
 */
export function returnTask(data) {
  return axios({
    url: '/workflow/task/return',
    method: 'post',
    data: data
  })
}

/**
 * 驳回任务
 * @param data
 * @returns {*}
 */
export function rejectTask(data) {
  return axios({
    url: '/workflow/task/reject',
    method: 'post',
    data: data
  })
}

/**
 * 拒绝任务
 * @param data
 * @returns {*}
 */
export function refuseTask(data) {
  return axios({
    url: '/workflow/task/refuse',
    method: 'post',
    data: data
  })
}

/**
 * 加签任务
 * @param data
 * @returns {*}
 */
export function addSignTask(data) {
  return axios({
    url: '/workflow/task/addSign',
    method: 'post',
    data: data
  })
}

/**
 * 多实例加签任务
 * @param data
 * @returns {*}
 */
export function multiInstanceAddSignTask(data) {
  return axios({
    url: '/workflow/task/multiInstanceAddSign',
    method: 'post',
    data: data
  })
}

/**
 * 跳转任务
 * @param data
 * @returns {*}
 */
export function jumpTask(data) {
  return axios({
    url: '/workflow/task/jump',
    method: 'post',
    data: data
  })
}

/**
 * 跳转任务节点列表
 * @param data
 * @returns {*}
 */
export function userTaskList(data) {
  return axios({
    url: '/workflow/task/userTask',
    method: 'post',
    data: data
  })
}

/**
 * 签收任务
 * @param data
 * @returns {*}
 */
export function claimTask(data) {
  return axios({
    url: '/workflow/task/claim',
    method: 'post',
    data: data
  })
}

/**
 * 可退回任务列表
 * @param data
 * @returns {*}
 */
export function returnList(data) {
  return axios({
    url: '/workflow/task/returnList',
    method: 'post',
    data: data
  })
}

/**
 * 获取下个任务节点信息
 * @param data
 * @returns {*}
 */
export function getNextFlowNode(data) {
  return axios({
    url: '/workflow/task/nextFlowNode',
    method: 'post',
    data: data
  })
}
